
import { put } from 'request'
import Request from './request.js'
let request = new Request().http
/*
 * 请求样式：
    自定义名字: function(data) {
        return request({
            url: "/banner", //请求头
            method: "GET", //请求方式 
            data: data,    //请求数据
            whetherData: true,  //是否数据格式规范接口
            hideLoading: false, //加载样式
        })
    }, 
 */
function get(url, data, whetherData = true, hideLoading, header) {
  return request({
    url: url,
    method: 'GET',
    data: data,
    header: header,
    whetherData: whetherData
  })
}


 
function post(url, data, whetherData = true, hideLoading, header) {
  return request({
    url: url,
    method: 'POST',
    data: data,
    header: header,
    whetherData: whetherData,
    hideLoading: hideLoading,
  })
}

function PUT(url, data, whetherData = true, hideLoading, header) {
  return request({
    url: url,
    method: 'PUT',
    data: data,
    header: header,
    whetherData: whetherData,
    hideLoading: hideLoading,
  })
}

let api = {
  /*
   *  ================版本号=================
   */

    login: data => post('api/v1/user/login', data, false, true),
//患者登录
 register: data => post('api/v1/user/register', data, false, true),
//注册
 info: data => post('api/v1/user/info', data, false, true),
  //账户信息
}
export default api;